package nl.saxion.act.bus;

import nl.saxion.act.gameframework.Actor;
import nl.saxion.act.gameframework.World;
import nl.saxion.act.gameframework.WorldView;
import nl.saxion.act.logging.Assert;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

public class BuswereldItem extends Actor {
    protected Bitmap bitmap;
    
	public BuswereldItem( int x, int y , Buswereld world, Buswereld.TILE_TYPES type ) {
		super( new Rect( 0, 0, 0, 0 ) );
		bitmap = world.getBitmap( type );
		int halfWidth =  (int) ( bitmap.getWidth() );
		int height    =  bitmap.getHeight() * 2;
		position.set( x - halfWidth, y - height, x + halfWidth, y );
	}

	public void draw( Canvas canvas, WorldView worldView ) {
		worldView.drawBitmap(bitmap, position, canvas );
	}
	
	public void handleCollision( World world, Actor actor) {
		Assert.fail( "handleCollision() should never be called for BusWorld" );
	}

    public String name() {
    	return this.getClass().getSimpleName() + ": (" + position.centerX() + ", " + position.bottom + ")";
    }
}
